
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.story.story_set</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.story.html"><font color="#ffffff">story</font></a>.story_set</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/story/story_set.py">telemetry/story/story_set.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.wpr.archive_info.html">telemetry.wpr.archive_info</a><br>
</td><td width="25%" valign=top><a href="inspect.html">inspect</a><br>
</td><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="telemetry.story.story.html">telemetry.story.story</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.story.story_set.html#StorySet">StorySet</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="StorySet">class <strong>StorySet</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;collection&nbsp;of&nbsp;stories.<br>
&nbsp;<br>
A&nbsp;typical&nbsp;usage&nbsp;of&nbsp;<a href="#StorySet">StorySet</a>&nbsp;would&nbsp;be&nbsp;to&nbsp;subclass&nbsp;it&nbsp;and&nbsp;then&nbsp;call<br>
AddStory&nbsp;for&nbsp;each&nbsp;Story.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="StorySet-AddStory"><strong>AddStory</strong></a>(self, story)</dt></dl>

<dl><dt><a name="StorySet-RemoveStory"><strong>RemoveStory</strong></a>(self, story)</dt><dd><tt>Removes&nbsp;a&nbsp;Story.<br>
&nbsp;<br>
Allows&nbsp;the&nbsp;stories&nbsp;to&nbsp;be&nbsp;filtered.</tt></dd></dl>

<dl><dt><a name="StorySet-WprFilePathForStory"><strong>WprFilePathForStory</strong></a>(self, story)</dt><dd><tt>Convenient&nbsp;function&nbsp;to&nbsp;retrieve&nbsp;WPR&nbsp;archive&nbsp;file&nbsp;path.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;story:&nbsp;The&nbsp;Story&nbsp;to&nbsp;look&nbsp;up.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;WPR&nbsp;archive&nbsp;file&nbsp;path&nbsp;for&nbsp;the&nbsp;given&nbsp;Story,&nbsp;if&nbsp;found.<br>
&nbsp;&nbsp;Otherwise,&nbsp;None.</tt></dd></dl>

<dl><dt><a name="StorySet-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="StorySet-__init__"><strong>__init__</strong></a>(self, archive_data_file<font color="#909090">=''</font>, cloud_storage_bucket<font color="#909090">=None</font>, base_dir<font color="#909090">=None</font>, serving_dirs<font color="#909090">=None</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;new&nbsp;<a href="#StorySet">StorySet</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;archive_data_file:&nbsp;The&nbsp;path&nbsp;to&nbsp;Web&nbsp;Page&nbsp;Replay's&nbsp;archive&nbsp;data,&nbsp;relative<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;self.<strong>base_dir</strong>.<br>
&nbsp;&nbsp;cloud_storage_bucket:&nbsp;The&nbsp;cloud&nbsp;storage&nbsp;bucket&nbsp;used&nbsp;to&nbsp;download<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Web&nbsp;Page&nbsp;Replay's&nbsp;archive&nbsp;data.&nbsp;Valid&nbsp;values&nbsp;are:&nbsp;None,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;story.PUBLIC_BUCKET,&nbsp;story.PARTNER_BUCKET,&nbsp;or&nbsp;story.INTERNAL_BUCKET<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(defined&nbsp;in&nbsp;telemetry.util.cloud_storage).<br>
&nbsp;&nbsp;serving_dirs:&nbsp;A&nbsp;set&nbsp;of&nbsp;paths,&nbsp;relative&nbsp;to&nbsp;self.<strong>base_dir</strong>,&nbsp;to&nbsp;directories<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;containing&nbsp;hash&nbsp;files&nbsp;for&nbsp;non-wpr&nbsp;archive&nbsp;data&nbsp;stored&nbsp;in&nbsp;cloud<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;storage.</tt></dd></dl>

<dl><dt><a name="StorySet-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="StorySet-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="StorySet-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>

<hr>
Class methods defined here:<br>
<dl><dt><a name="StorySet-Description"><strong>Description</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Return&nbsp;a&nbsp;string&nbsp;explaining&nbsp;in&nbsp;human-understandable&nbsp;terms&nbsp;what&nbsp;this<br>
story&nbsp;represents.<br>
Note&nbsp;that&nbsp;this&nbsp;should&nbsp;be&nbsp;a&nbsp;classmethod&nbsp;so&nbsp;the&nbsp;benchmark_runner&nbsp;script&nbsp;can<br>
display&nbsp;stories'&nbsp;names&nbsp;along&nbsp;with&nbsp;their&nbsp;descriptions&nbsp;in&nbsp;the&nbsp;list&nbsp;command.</tt></dd></dl>

<dl><dt><a name="StorySet-Name"><strong>Name</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Returns&nbsp;the&nbsp;string&nbsp;name&nbsp;of&nbsp;this&nbsp;<a href="#StorySet">StorySet</a>.<br>
Note&nbsp;that&nbsp;this&nbsp;should&nbsp;be&nbsp;a&nbsp;classmethod&nbsp;so&nbsp;the&nbsp;benchmark_runner&nbsp;script&nbsp;can<br>
match&nbsp;the&nbsp;story&nbsp;class&nbsp;with&nbsp;its&nbsp;name&nbsp;specified&nbsp;in&nbsp;the&nbsp;run&nbsp;command:<br>
'Run&nbsp;&lt;User&nbsp;story&nbsp;test&nbsp;name&gt;&nbsp;&lt;User&nbsp;story&nbsp;class&nbsp;name&gt;'</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>allow_mixed_story_states</strong></dt>
<dd><tt>True&nbsp;iff&nbsp;Stories&nbsp;are&nbsp;allowed&nbsp;to&nbsp;have&nbsp;different&nbsp;StoryState&nbsp;classes.<br>
&nbsp;<br>
There&nbsp;are&nbsp;no&nbsp;checks&nbsp;in&nbsp;place&nbsp;for&nbsp;determining&nbsp;if&nbsp;SharedStates&nbsp;are<br>
being&nbsp;assigned&nbsp;correctly&nbsp;to&nbsp;all&nbsp;Stories&nbsp;in&nbsp;a&nbsp;given&nbsp;StorySet.&nbsp;The<br>
majority&nbsp;of&nbsp;test&nbsp;cases&nbsp;should&nbsp;not&nbsp;need&nbsp;the&nbsp;ability&nbsp;to&nbsp;have&nbsp;multiple<br>
SharedStates,&nbsp;which&nbsp;usually&nbsp;implies&nbsp;you&nbsp;should&nbsp;be&nbsp;writing&nbsp;multiple<br>
benchmarks&nbsp;instead.&nbsp;We&nbsp;provide&nbsp;errors&nbsp;to&nbsp;avoid&nbsp;accidentally&nbsp;assigning<br>
or&nbsp;defaulting&nbsp;to&nbsp;the&nbsp;wrong&nbsp;SharedState.<br>
Override&nbsp;at&nbsp;your&nbsp;own&nbsp;risk.&nbsp;Here&nbsp;be&nbsp;dragons.</tt></dd>
</dl>
<dl><dt><strong>archive_data_file</strong></dt>
</dl>
<dl><dt><strong>base_dir</strong></dt>
<dd><tt>The&nbsp;base&nbsp;directory&nbsp;to&nbsp;resolve&nbsp;archive_data_file.<br>
&nbsp;<br>
This&nbsp;defaults&nbsp;to&nbsp;the&nbsp;directory&nbsp;containing&nbsp;the&nbsp;StorySet&nbsp;instance's&nbsp;class.</tt></dd>
</dl>
<dl><dt><strong>bucket</strong></dt>
</dl>
<dl><dt><strong>file_path</strong></dt>
</dl>
<dl><dt><strong>serving_dirs</strong></dt>
</dl>
<dl><dt><strong>wpr_archive_info</strong></dt>
<dd><tt>Lazily&nbsp;constructs&nbsp;wpr_archive_info&nbsp;if&nbsp;it's&nbsp;not&nbsp;set&nbsp;and&nbsp;returns&nbsp;it.</tt></dd>
</dl>
</td></tr></table></td></tr></table>
</body></html>